package opp.arrayadd;

public class bubbleSort1 {
    public static void main(String[] args) {
        //冒泡数组进行排序复习
        int [] arr1={9,5,-3,-99,55};
        int temp=0;
        for(int i=0;i<arr1.length-1;i++)
        {

            for(int j = 0; j<arr1.length-1-i; j++)
            {
                if(arr1[j]>arr1[j+1])
                {
                    temp=arr1[j];
                    arr1[j]=arr1[j+1];
                    arr1[j+1]=temp;
                }
            }
            System.out.println("\n第"+(i+1)+"轮");
            for(int j=0;j<arr1.length;j++)
            {
                System.out.print(arr1[j]+" ");
            }
        }
    }

}